<template>
  <a-spin :spinning="confirmLoading">
    <j-form-container :disabled="false">
      <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
        <a-divider>基本信息</a-divider>
        <a-row :gutter="48">
          <a-col :span="8" :hidden="true">
            <a-form-model-item label="标题" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="bpmBizTitle">
              <a-input :max-length="255" :disabled="formDisabled" v-model="model.bpmBizTitle" placeholder="请输入流程名称"></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="8">
            <a-form-model-item label="单据编号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="billNo">
              <a-input v-model="model.billNo" :max-length="36"  placeholder="请输入单据编号" disabled ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="8">
            <a-form-model-item label="申请时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="billNo">
              <a-input v-model="model.createTime" :max-length="36"  placeholder="请选择申请时间" disabled ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="8">
            <a-form-model-item label="申请人" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="proposer">
              <select-user-by-dep   :multi="false" v-model="model.proposer"  disabled></select-user-by-dep>
            </a-form-model-item>
          </a-col>
          <a-col :span="8">
            <a-form-model-item label="申请人部门" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="proposerDeptId">
              <j-select-depart v-model="model.proposerDeptId" disabled />
            </a-form-model-item>
          </a-col>
        </a-row>

        <a-divider>项目信息</a-divider>

        <a-row :gutter="48">
          <a-col :span="8">
            <a-form-model-item label="项目名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="projectId">
              <a-input  readOnly @click.prevent="onDetail(model.projectId)"  v-model="model.projectName" style="color: #1890FF; cursor: pointer;"  placeholder="请选择项目名称"></a-input>
<!--              <select-project-input v-else ref="projectInput" :disabled="formDisabled" v-model="model.projectId" :proDisabled="true" :allowClear="false" placeholder="请输入选择项目" :projectStatus="'2'" @input="projectChangeHandle" disabled/>-->
            </a-form-model-item>
          </a-col>
          <a-col :span="8">
            <a-form-model-item label="项目编号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="projectNo">
              <a-input v-model="model.projectNo" :max-length="36"  placeholder="请输入项目编号"  disabled></a-input>
            </a-form-model-item>
          </a-col>

          <a-col :span="8">
            <a-form-model-item label="签订单位" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="signUnit">
              <select-Company-input v-model="model.signUnit" placeholder="请选择签订单位" disabled />
            </a-form-model-item>
          </a-col>

          <a-col :span="8">
            <a-form-model-item  label="经营团队" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="managementTeam">
              <select-team-input
                v-model="model.managementTeam"
                :tdlx="1"
                disabled
              />
            </a-form-model-item>
          </a-col>

          <a-col :span="8">
            <a-form-model-item label="项目承接人" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="undertaker">
              <select-user-by-dep   :multi="false" v-model="model.undertaker"  disabled></select-user-by-dep>
            </a-form-model-item>
          </a-col>
          <a-col :span="8">
            <a-form-model-item label="项目地址" :labelCol="labelCol" :wrapperCol="wrapperCol" style="height:75px" prop="projectAddress">
              <a-form-model-item :style="{display:'inline-block',width:'48%'}" prop="projectAddress">
                <AddressChoice type="cascader" v-model="model.area" placeholder="请输入省市区" disabled/> 
              </a-form-model-item>
              <a-form-model-item
                :style="{'margin-top':'0px','margin-left':'5px',display:'inline-block',width:'50%'}"
                prop="projectAddress">
                <a-input v-model="model.projectAddress" placeholder="请输入项目详细地址" disabled></a-input>
              </a-form-model-item>
            </a-form-model-item>

          </a-col>
          <a-col :span="8">
            <a-form-model-item label="业务名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="businessName">
              <select-task-file-for-project-archive-input :disabled="formDisabled" v-model="model.businessName" :projectId="model.projectId" :allowClear="false" :isShowCategoryName="true" :isExcludeWaitingStatus="true" @input="taskChangeBackHandle" disabled/>
            </a-form-model-item>
          </a-col>
          <a-col :span="8">
            <a-form-model-item label="任务编号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="taskNo">
              <a-input v-model="model.taskNo" :max-length="36"  placeholder="请输入任务编号" disabled ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="8">
            <a-form-model-item label="实施部门" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="implementationDepartment">
              <j-select-depart v-model="model.implementationDepartment" disabled/>
            </a-form-model-item>
          </a-col>

          <a-col :span="8">
            <a-form-model-item  label="生产团队" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="productionTeam">
              <select-team-input
                v-model="model.productionTeam"
                :tdlx="1"
                disabled
              />
<!--              <a-input :disabled="formDisabled" v-model="model.productionTeam" placeholder="请输入生产团队" disabled  ></a-input>-->
<!--              <a-input :hidden="true" :disabled="formDisabled" v-model="model.productionTeamId" placeholder="请输入生产团队" disabled  ></a-input>-->
            </a-form-model-item>
          </a-col>

          <a-col :span="8">
            <a-form-model-item label="项目负责人" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="projectLeading">
              <select-user-by-dep
                v-model="model.projectLeader"
                disabled/>
            </a-form-model-item>
          </a-col>


          <a-col :span="8">
            <a-form-model-item label="行业类别" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="industryCategory">
<!--              <a-input :disabled="formDisabled" v-model="model.industryCategory" :max-length="36"  placeholder="请输入行业类别"  disabled></a-input>-->
              <j-dict-select-tag
                type="list"
                v-model="model.industryCategory"
                dictCode="industry_category"
                placeholder="请选择行业类别"
                disabled/>
            </a-form-model-item>
          </a-col>
          <a-col :span="8">
            <a-form-model-item label="审批级别" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="approvalLevel">
              <a-input v-model="model.approvalLevel" :max-length="36"  placeholder="请输入审批级别" disabled ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="8">
            <a-form-model-item label="审批机构" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="approvalAuthority">
              <a-input v-model="model.approvalAuthority" :max-length="36"  placeholder="请输入审批机构" disabled ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="8">
            <a-form-model-item label="投资额(元)" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="investmentAmount">
              <a-input-number :max="999999999" :min="0" :precision="2" v-model="model.investmentAmount" placeholder="请输入投资额(元)" style="width: 100%" disabled/>
            </a-form-model-item>
          </a-col>
          <a-col :span="8">
            <a-form-model-item label="规模" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="scale">
              <a-input v-model="model.scale" :max-length="36"  placeholder="请输入规模"  disabled></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="8">
            <a-form-model-item label="批复文号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="approvalDocumentNo">
              <a-input v-model="model.approvalDocumentNo" :max-length="36"  placeholder="请输入批复文号"  disabled></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="8">
            <a-form-model-item label="批复日期" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="approvalDate">
              <j-date placeholder="请选择批复日期" v-model="model.approvalDate"  style="width: 100%" disabled/>
            </a-form-model-item>
          </a-col>
          <template v-if="model.archiveMajorCategory || showFlowSubmitButton">
<!--            <a-col :span="8">-->
<!--              <a-form-model-item label="档案大类" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="archiveMajorCategory">-->
<!--                <j-dict-select-tag :disabled="formDisabled" type="list" v-model="model.archiveMajorCategory" dictCode="sys_category,name,id,pid = '1655763364338606082'" placeholder="请选择档案大类" @input="archiveMajorCategoryInputHandle" />-->
<!--              </a-form-model-item>-->
<!--            </a-col>-->
<!--            <a-col :span="8">-->
<!--              <a-form-model-item label="档案小类" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="archiveMinorCategory">-->
<!--                <j-dict-select-tag :disabled="formDisabled" type="list" v-model="model.archiveMinorCategory" :dictCode="`sys_category,name,id,pid = '${model.archiveMajorCategory}'`" placeholder="请选择档案小类" />-->
<!--              </a-form-model-item>-->
<!--            </a-col>-->
              <a-col :span="8">
                <a-form-model-item label="档案大类" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="archiveMajorCategory">
                  <j-dict-select-category :disabled="formDisabled" v-model="model.archiveMajorCategory" placeholder="请选择档案大类" parentCode="A04" removeCode="A04A02,A04A01" :async="true" @input="modifyCategory"/>
                </a-form-model-item>
              </a-col>
              <a-col :span="8">
                <a-form-model-item label="档案小类" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="archiveMajorCategory">
                  <j-dict-select-category :disabled="formDisabled || !model.archiveMajorCategory" v-model="model.archiveMinorCategory" placeholder="请选择档案小类" :parentCode="model.archiveMajorCategory ? model.archiveMajorCategory : ''" :async="true"/>
                </a-form-model-item>
              </a-col>


            <a-col :span="8">
              <a-form-model-item label="档案所属团队" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="archiveBelongingTeam">
                <select-team-input
                  :disabled="formDisabled"
                  v-model="model.archiveBelongingTeam"
                  :tdlx="1"
                />
              </a-form-model-item>
            </a-col>
            <a-col :span="8">
              <a-form-model-item label="密级" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="secrecyLevel">
<!--                <a-input :disabled="formDisabled" v-model="model.secrecyLevel" :max-length="36"  placeholder="请输入密级"  ></a-input>-->
                <j-dict-select-tag :disabled="formDisabled" type="list" v-model="model.secrecyLevel" dictCode="secrecy_level" placeholder="请选择密级" />
              </a-form-model-item>
            </a-col>
          </template>
        </a-row>
        <a-divider>存档信息</a-divider>
        <a-row :gutter="48">
          <erp-project-archive-info-list ref="projectArchiveInfo"  :disabled="showFlowSubmitButton" />
        </a-row>

        <a-divider>任务附件</a-divider>
        <a-row :gutter="48">
          <a-col :span="24">
            <a-form-model-item label="附件" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="attachments">
              <j-upload :disabled="formDisabled" v-model="model.attachments"></j-upload>
            </a-form-model-item>
          </a-col>
        </a-row>



        <a-row :gutter="48">
          <a-col :span="24" style="text-align: center;margin-top: 15px">
            <a-button type="primary" v-if="formBpm" :style="{ marginRight: showFlowSubmitButton?'10px':'0px' }" @click="onPrint">打印</a-button>
            <a-button @click="submitForm('submit')" v-if="showFlowSubmitButton">提 交</a-button>
          </a-col>
        </a-row>


      </a-form-model>
    </j-form-container>

    <!-- 项目详情开始 -->
    <erp-project-report-modal  ref="projectModalForm"></erp-project-report-modal>
    <!-- 项目详情结束 -->
    <ErpProjectArchiveFormPrint v-if="formBpm" id="printContentEdit" class="print_style" :formData="model1" :formDataHistory="formData"></ErpProjectArchiveFormPrint>
  </a-spin>
</template>

<script>

  import { httpAction, getAction } from '@/api/manage'
  import { validateDuplicateValue } from '@/utils/util'
  import SelectUserByDep from '@/views/scy/components/SelectUserByDep'
  import SelectTeamInput from '@/views/scy/components/SelectTeamInput'
  import SelectCompanyInput from '@/views/scy/components/SelectCompanyInput'
  import SelectCustomerInput from '@/views/scy/components/SelectCustomerInput'
  import SelectProjectInput from '@/views/scy/components/SelectProjectInput'
  import SelectTaskFileForProjectArchiveInput from '@/views/scy/components/SelectTaskFileForProjectArchiveInput'
  import SelectProjectTaskInput from '@/views/scy/components/SelectProjectTaskInput.vue';
  import AddressChoice from '@/components/AddressChoice/AddressChoice';
  import JDictSelectCategory from '@/components/dict/JDictSelectCategory.vue'
  import moment from 'moment'
  import { mapGetters } from 'vuex'
  import ErpProjectArchiveInfoList from '../ErpProjectArchiveInfoList.vue';
  import { filterMultiDictText, initDictOptions } from '@/components/dict/JDictSelectUtil'
  import ErpProjectReportModal from '@/views/erp/report/project/modules/ErpProjectReportModal'
  import { viewFile } from '@/utils/util';
  import ViewFileModal from '@/views/scy/components/ViewFileModal';
  import CommonFlowList from '@/views/components/CommonFlowList.vue';
  import ErpProjectArchiveFormPrint from './ErpProjectArchiveFormPrint'
  import Print from '@/utils/print/printarea.js';
  export default {
    name: 'ErpProjectArchiveForm',
    mixins: [viewFile],
    components: {
      ErpProjectArchiveInfoList,
      SelectUserByDep,
      SelectTeamInput,
      SelectCompanyInput,
      SelectCustomerInput,
      SelectProjectInput,
      SelectTaskFileForProjectArchiveInput,
      SelectProjectTaskInput,
      AddressChoice,
      JDictSelectCategory,
      ErpProjectReportModal,
      ViewFileModal,
      CommonFlowList,
      ErpProjectArchiveFormPrint
    },
    props: {
      //流程表单data
      formData: {
        type: Object,
        default: ()=>{},
        required: false
      },
      //表单模式：true流程表单 false普通表单
      formBpm: {
        type: Boolean,
        default: false,
        required: false
      },
      //表单禁用
      disabled: {
        type: Boolean,
        default: false,
        required: false
      }
    },
    data () {
      return {
        model:{},
        model1:{},
        labelCol: {
        },
        wrapperCol: {
          xs: { span: 24 },
          sm: { span: 24 },
        },
        confirmLoading: false,
        validatorRules: {
          projectId: [
            { required: true, message: '请选择项目名称!' },
          ],
          businessName: [
            { required: true, message: '请选择业务名称!' },
          ],
          archiveMajorCategory: [
            { required: true, message: '请选择档案大类!' },
          ],
          archiveMinorCategory: [
            { required: true, message: '请选择档案小类!' },
          ],
          archiveBelongingTeam: [
            { required: true, message: '请选择档案所属团队!' },
          ],
          secrecyLevel: [
            { required: true, message: '请选择密级!' },
          ],
        },
        url: {
          add: "/api/erp/omc/projectarchive/erpProjectArchive/add",
          edit: "/api/erp/omc/projectarchive/erpProjectArchive/edit",
          queryById: "/api/erp/omc/projectarchive/erpProjectArchive/queryById",
          getBillNo: '/api/erp/omc/projectarchive/erpProjectArchive/getBillNo',
          queryProjectById: '/api/erp/project/report/erpProjectReport/queryById',
        },
        dictOptions: {},
        projectIdBackups: null
      }
    },
    computed: {
      formDisabled(){
        if(this.formBpm===true){
          if(this.formData.disabled===false){
            return false
          }
          return true
        }
        return this.disabled
      },
      showFlowSubmitButton(){
        if(this.formBpm===true){
          if(this.formData.disabled===false){
            return true
          }
        }
        return false
      }
    },
    created () {
       //备份model原始值
      this.modelDefault = JSON.parse(JSON.stringify(this.model));
      //如果是流程中表单，则需要加载流程表单data
      this.showFlowData();
      //加载数据字典信息
      this.initDictConfig();
    },
    methods: {
      ...mapGetters(['userInfo']),


      initDictConfig() {
        initDictOptions('erp_omc_project_task,category_name,id').then((res) => {
          if (res.success) {
            this.$set(this.dictOptions, 'businessName', res.result)
          }
        })
        initDictOptions('erp_omc_project,project_name,id').then((res) => {
          if (res.success) {
            this.$set(this.dictOptions, 'projectId', res.result)
          }
        })
      },

      //修改大类，清空小类
      modifyCategory(data){
        if(data){
          if(this.model.archiveMinorCategory){
            this.$set(this.model,"archiveMinorCategory",null);
          }
        }
      },

      add () {
        this.edit(this.modelDefault);
        this.model.proposer = this.userInfo().empId;
        this.model.proposerDeptId = this.userInfo().deptId;
        this.model.createTime = moment().format('YYYY-MM-DD HH:mm:ss');
        this.getBillNo();

        this.projectIdBackups = null
      },
      edit (record) {
        this.$refs.form.resetFields();
        this.model = Object.assign({}, record);
        this.model1 = Object.assign({}, record);
        if (this.model.id) {
          this.$refs.projectArchiveInfo.loadData(1, this.model.id)
        } else {
          this.$refs.projectArchiveInfo.dataSource = []
        }
        //如果有项目id说明是编辑页面，就把原始id给它
        if(!!this.model.projectId){
          this.projectIdBackups = this.model.projectId
        }

        this.visible = true;
      },
      //渲染流程表单数据
      showFlowData(){
        if(this.formBpm === true){
          let params = {id:this.formData.dataId};
          getAction(this.url.queryById,params).then((res)=>{
            if(res.success){
              this.edit (res.result);
            }
          });
        }
      },

      //项目选择回调
      async projectChangeHandle({choseObj}){
        let backItem = choseObj[0]

        if (!this.model.id && !this.projectIdBackups){
          this.projectIdBackups = this.model.projectId
          //带出项目编号
          this.$set(this.model,'projectNo',backItem.finalNo)

          //带出项目真实名称
          this.$set(this.model, 'projectName', backItem.projectName)

          //带出签订单位
          this.$set(this.model,'signUnit',backItem.signUnit)

          //带出项目承接人
          this.$set(this.model,'undertaker',backItem.undertaker)

          //带出经营团队
          this.$set(this.model, 'managementTeam', backItem.oldTeamId ? backItem.oldTeamId : backItem.teamName)

          //带出项目地址
          this.$set(this.model,'area',backItem.areaCode)

          //带出项目地址
          this.$set(this.model,'projectAddress',backItem.projectAddress)
        }
        //切换项目清空子表弹窗提示
        if(this.projectIdBackups && this.projectIdBackups !== backItem.id) {
          // if (detailList.length > 0){
          const that = this;
          this.$confirm({
            title: '确认切换项目',
            content: '切换项目会清空所有任务相关信息，您确定要切换吗?',
            okText:'确定',
            cancelText:'取消',
            onOk: async function () {
              //确认后进行改变
              that.projectIdBackups = that.model.projectId

              //清空所有带出数据
              that.resetData();

              //带出项目编号
              that.$set(that.model,'projectNo',backItem.finalNo)

              //带出项目真实名称
              that.$set(that.model, 'projectName', backItem.projectName)

              //带出签订单位
              that.$set(that.model,'signUnit',backItem.signUnit)

              //带出项目承接人
              that.$set(that.model,'undertaker',backItem.undertaker)

              //带出经营团队
              that.$set(that.model, 'managementTeam', backItem.oldTeamId ? backItem.oldTeamId : backItem.teamName)

              //带出项目地址
              that.$set(that.model,'area',backItem.areaCode)

              //带出项目地址
              that.$set(that.model,'projectAddress',backItem.projectAddress)


            },
            onCancel() {
              that.model.projectId = that.projectIdBackups
            }
          });
        }

      },
      //清除所有带出数据
      resetData(){
        //带出项目编号
        this.$set(this.model,'projectNo',null)

        //带出项目真实名称
        this.$set(this.model, 'projectName', null)

        //带出签订单位
        this.$set(this.model,'signUnit',null)

        //带出项目承接人
        this.$set(this.model,'undertaker',null)

        //带出经营团队
        this.$set(this.model,'managementTeam',null)

        //带出项目地址
        this.$set(this.model,'area',null)

        //带出项目地址
        this.$set(this.model,'projectAddress',null)

        //清除业务分类
        this.$set(this.model,'businessName',null)

        //带出任务编号
        this.$set(this.model,'taskNo',null)

        //带出实施部门
        this.$set(this.model,'implementationDepartment',null)

        //带出生产团队
        this.$set(this.model,'productionTeam',null)

        //带出项目负责人
        this.$set(this.model,'projectLeader',null)

        //带出行业类别
        this.$set(this.model,'industryCategory',null)

        //带出审批级别
        this.$set(this.model,'approvalLevel',null)
      },

      //业务名称选择回调
      taskChangeBackHandle(item){
        let task = item.choseObj[0];
        if (task){

          //带出任务编号
          this.$set(this.model,'taskNo',task.billNo)

          //带出实施部门
          this.$set(this.model,'implementationDepartment',task.executeDepart)

          //带出生产团队
          this.$set(this.model,'productionTeam',task.productTeam)

          //带出项目负责人
          this.$set(this.model,'projectLeader',task.projectLeading)

          //带出行业类别
          this.$set(this.model,'industryCategory',task.industryCategory)

          //带出审批级别
          this.$set(this.model,'approvalLevel',task.approvalLevel)

        }

      },

      //大类切换
      archiveMajorCategoryInputHandle(value){
        //清空小类
        this.$set(this.model,'archiveMinorCategory',null)
      },


      //获取编号
      getBillNo(){
        let that=this;
        getAction(this.url.getBillNo, {}).then((res) => {
          if (res.success) {
            let data = res.result.records || res.result
            this.$set(this.model, 'billNo', data);
            // this.$set(this.model, 'bpmBizTitle', this.userInfo().employee.name+'-'+data);
          }
        })
      },



      onDetail(id) {
        const that = this
        this.$nextTick(() => {
          getAction(this.url.queryProjectById, { id }).then((res) => {
            if (res.success) {
              const model = res.result
              that.$refs.projectModalForm.getDetail(model);
              that.$refs.projectModalForm.title = '项目一览表';
            }
          })
        })
      },




      submitForm () {
        let details = this.$refs.projectArchiveInfo.submitForm();
        const that = this;

        if(!details.length > 0) {
          this.$message.warning('请添加存档信息！');
          this.$emit('unButtonDisable');
          return
        }

        this.$set(this.model, 'bpmBizTitle','项目存档申请单-'+ filterMultiDictText(this.dictOptions['projectId'], this.model.projectId + '') +'-'+ filterMultiDictText(this.dictOptions['businessName'], this.model.businessName + '') + '-' + this.userInfo().employee.name+'-' + moment(this.model.createTime).format('YYYY-MM-DD'));

        // 触发表单验证
        this.$refs.form.validate(valid => {
          if (valid) {
            that.confirmLoading = true;
            let httpurl = '';
            let method = '';
            if(!this.model.id){
              httpurl+=this.url.add;
              method = 'post';
            }else{
              httpurl+=this.url.edit;
              method = 'put';
            }
            this.model.details = details
            httpAction(httpurl,this.model,method).then((res)=>{
              if(res.success){
                that.$message.success(res.message);
                that.$emit('ok');
                getAction(that.url.queryById,{id:this.model.id}).then((res)=>{
                  if (res.success) {
                    that.model1 = res.result
                  }
                })
              }else{
                that.$message.warning(res.message);
                that.$emit('unButtonDisable');
              }
            }).catch((error)=>{
              that.$emit('unButtonDisable');
            }).finally(() => {
              that.confirmLoading = false;
            })
          }else {
          that.$emit('unButtonDisable');
          }

        })
      },

      // 点击打印
      onPrint () {
        let print = new Print({
          el: '#printContentEdit',
          popTitle: '项目存档申请单详情 · 禾美环保',
          endCallback() {

          }
        })
      }
    }
  }
</script>
